package com.jd.sunny.java.designpattern.simplefactory;

/**
 * @author :����
 * @ClassName:CarFactory
 * @Description:
 * @date :2012-8-23����11:07:29
 */
public class CarFactory {

    public static Car getCar(String name) {
        Car car = null;
        if ("benz".equalsIgnoreCase(name)) {
            car = new Benz();
        } else if ("bmw".equalsIgnoreCase(name)) {
            car = new Bmw();
        } else if ("audi".equalsIgnoreCase(name)) {
            car = new Audi();
        }
        return car;
    }

}
